//
//  RootViewController.m
//  DP_Project
//
//  Created by iOS on 14-10-15.
//  Copyright (c) 2014年 iOS. All rights reserved.
//

#import "RootViewController.h"
#import "DPAPI.h"
@interface RootViewController ()<UITableViewDataSource,UITableViewDelegate>

@property(nonatomic,retain)UIScrollView * scrollView;
@property(nonatomic,retain)UIButton * backButton;
@property(nonatomic,retain)UIButton * cityButton;
@property(nonatomic,retain)UIButton * button1;
@property(nonatomic,retain)UIButton * button2;
@property(nonatomic,retain)UIButton * button3;
@property(nonatomic,retain)UIButton * button4;
@property(nonatomic,retain)UITableView * tableView;
@property(nonatomic,retain)UIButton * findButton;




@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
   
    self.navigationController.navigationBar.translucent = NO;
    _findButton = [[UIButton alloc]initWithFrame:CGRectMake(80, 10, 160, 20)];
    _findButton.backgroundColor = [UIColor redColor];
    [_findButton setTitle:@"请输入商户、地点" forState:UIControlStateNormal];
    [_findButton addTarget:self action:@selector(findButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    [_findButton.layer setCornerRadius:5];
    [self.navigationController.navigationBar addSubview:_findButton];
    [_findButton release];
    
    
    _scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, 320, 120)];
    _scrollView.backgroundColor = [UIColor redColor];
    _scrollView.contentSize = CGSizeMake(320 * 4, 100);
    _scrollView.pagingEnabled = YES;
    [self.view addSubview:_scrollView];
    [_scrollView release];
    
    _button1 = [[UIButton alloc]initWithFrame:CGRectMake(0, 100, 80, 80)];
    _button1.backgroundColor = [UIColor greenColor];
    [_button1 addTarget:self action:@selector(button1Action:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_button1];
    [_button1 release];
    
    _button2 = [[UIButton alloc]initWithFrame:CGRectMake(80, 100, 80, 80)];
    _button2.backgroundColor = [UIColor yellowColor];
    [_button2 addTarget:self action:@selector(button2Action:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_button2];
    [_button2 release];
    
    _button3 = [[UIButton alloc]initWithFrame:CGRectMake(160, 100, 80, 80)];
    _button3.backgroundColor = [UIColor greenColor];
    [_button3 addTarget:self action:@selector(button3Action:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_button3];
    [_button3 release];
    
    _button4 = [[UIButton alloc]initWithFrame:CGRectMake(240, 100, 80, 80)];
    _button4.backgroundColor = [UIColor yellowColor];
    [_button4 addTarget:self action:@selector(button4Action:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_button4];
    [_button4 release];
    
    _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 200, 320, 302) style:UITableViewStylePlain];
    _tableView.delegate = self;
    _tableView.dataSource = self;
    _tableView.rowHeight = 80;
    [self.view addSubview:_tableView];
    [_tableView release];
    
    
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 0;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString * indentifier = @"cell";
    UITableViewCell * cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:indentifier];
    if (!cell) {
        cell = [[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:indentifier]autorelease];
    }
    return cell;
}

-(void)button1Action:(id)sender
{
    
}

-(void)button2Action:(id)sender
{
    
}

-(void)button3Action:(id)sender
{
    
}

-(void)button4Action:(id)sender
{
    
}
-(void)findButtonAction:(id)sender
{
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
